{% extends 'template.html' %}

{% block username %}
    {{ head.username }}
{% endblock %}

{% block content %}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">{{ head.value }}</h1>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="btn-group">
                            {% if user.is_superuser %}
                            <a>
                                <button id='bt-add' type="button" class="btn btn-primary">增加</button>
                            </a>
                            <a>
                                <button id='bt-del' data-text="确定删除? 0个" type="button" class="btn btn-danger">删除
                                </button>
                            </a>
                            {% endif %}
                            <a>
                                <button id='bt-search' type="button" class="btn btn-success">高级搜索</button>
                            </a>
                            <a>
                                <button id='bt-reset' type="button" class="btn btn-danger">重置高级搜索</button>
                            </a>
                        </div>
                        <div class="pull-right">
                            <div class="btn-group">
                                <a href='/assets/upload/'>
                                    <button id='bt-upload' type="button" class="btn btn-primary">上传</button>
                                </a>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div id="div-search" class="hide">
                            <table id="high-search" style="width: 67%; margin: 0 auto 2em auto;" border="0"
                                   cellpadding="3" cellspacing="0">
                                <thead>
                                <tr>
                                    <th>目标</th>
                                    <th>内容</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr id="_filter_belongs_to_game_project" data-column="2">
                                    <td>所属项目</td>
                                    <td align="center">
                                        <select id="filter_belongs_to_game_project" class="filter_select2"
                                                style="width: 100%">
                                            <option value="全部" selected="selected">全部</option>
                                            {% for project in head.data.all_project %}
                                                <option value={{ project.id }}>{{ project.text }}</option>
                                            {% endfor %}
                                        </select>
                                    </td>
                                </tr>
                                <tr id="_filter_weekdays_person" data-column="5">
                                    <td>周一到周五晚上跟进</td>
                                    <td align="center">
                                        <select id="filter_weekdays_person" class="filter_select2" style="width: 100%">
                                            <option value="全部" selected="selected">全部</option>
                                            {% for user in head.data.all_ops_user %}
                                                <option value={{ user.id }}>{{ user.text }}</option>
                                            {% endfor %}
                                        </select>
                                    </td>
                                </tr>
                                <tr id="_filter_weekend_person" data-column="5">
                                    <td>周六日值班</td>
                                    <td align="center">
                                        <select id="filter_weekend_person" class="filter_select2" style="width: 100%">
                                            <option value="全部" selected="selected">全部</option>
                                            {% for user in head.data.all_ops_user %}
                                                <option value={{ user.id }}>{{ user.text }}</option>
                                            {% endfor %}
                                        </select>
                                    </td>
                                </tr>
                                <tr id="_filter_date" data-column="4">
                                    <td>起止时间</td>
                                    <td align="center">
                                        <input class="flatpickr flatpickr-input" type="text" placeholder="选择开始时间"
                                               data-id="datetime" id="filter_start_date" readonly="readonly">
                                        <span>到</span>
                                        <input class="flatpickr flatpickr-input" type="text" placeholder="选择结束时间"
                                               data-id="datetime" id="filter_end_date" readonly="readonly">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <table id="mytable" class="display" width="100%" cellspacing="0">
                            <thead>
                            <tr>
                                <th class="center sorting_disabled">
                                    <label class="pos-rel">
                                        <input id='chb-all' type="checkbox"/>
                                    </label>
                                </th>
                                <th>id</th>
                                <th>所属项目</th>
                                <th>值班时间</th>
                                <th>周一到周五晚上跟进</th>
                                <th>周六日值班</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
            <!-- Modal -->
            <div class="modal fade" id="myModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="myModalLabel"></h4>
                        </div>
                        <div class="modal-body">
                            <div class="alert alert-danger alert-dismissable" id='modal-notify'>
                                <button type="button" class="close" id="bt-modal-notify">&times;</button>
                                <label id='lb-msg'></label>
                            </div>
                            <form class="form-horizontal" role="form">
                                <div class="form-group" id='show_id'>
                                    <label class="col-sm-3 control-label">id</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control " placeholder="" id="id">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">所属项目</label>
                                    <div class="col-sm-8">
                                        <select id="belongs_to_game_project" style="width: 100%">
                                            <!--<option selected="selected" value="0">选择项目</option>-->
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">开始值班时间</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control flatpickr flatpickr-input"
                                               id="start_date">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">结束值班时间</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control flatpickr flatpickr-input" id="end_date">
                                    </div>
                                </div>
                                <!--
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">周二更新</label>
                                      <div class="col-sm-8">
                                        <select id="tuesday_person" class="game_project_person" style="width: 100%">
                                          <option selected="selected" value="0">选择负责人</option>
                                        </select>
                                      </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">周四更新</label>
                                      <div class="col-sm-8">
                                        <select id="thursday_person" class="game_project_person" style="width: 100%">
                                          <option selected="selected" value="0">选择负责人</option>
                                        </select>
                                      </div>
                                </div>
                                -->
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">周一到周五晚上</label>
                                    <div class="col-sm-8">
                                        <select id="weekdays_person" class="game_project_person" style="width: 100%">
                                            <!--<option selected="selected" value="0">选择负责人</option>-->
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">周六日值班</label>
                                    <div class="col-sm-8">
                                        <select id="weekend_person" class="game_project_person" style="width: 100%">
                                            <!--<option selected="selected" value="0">选择负责人</option>-->
                                        </select>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            <button id='bt-save' type="button" class="btn btn-primary">保存</button>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal-dialog -->
            </div><!-- /.modal -->
            <div class="modal fade" id="Modal-file" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <form id="submit-file-form" enctype="multipart/form-data" action="/assets/upload_devices"
                              method="post">
                            <!-- {% csrf_token %} -->
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;
                                </button>
                                <h4 class="modal-title" id="myModalLabel">导入/导出</h4>
                            </div>
                            <div class="modal-body">
                                <div class="alert alert-dismissable" id='upload-notify'>
                                    <button type="button" class="close" id="bt-upload-notify">&times;</button>
                                    <label id='lb-msg-upload'></label>
                                </div>

                                <div class="form-group">
                                    {{ form }}
                                    <p class="help-block">Example block-level help text here.</p>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-primary" name='action'>保存</button>
                            </div>
                        </form>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal-dialog -->
            </div>
        </div>
    </div>
{% endblock %}
{% block bodyjs %}
    <script src="/static/js/jquery.dataTables.js"></script>
    {{ django_context_varable }}
    {% verbatim %}
    <script id="tpl" type="text/x-handlebars-template">
        {{#each func}}
        <button type="button" class="btn btn-{{this.type}} btn-sm" onclick="{{this.fn}}">{{this.name}}</button>
        {{/each}}
    </script>
    {% endverbatim %}
    <script src="/static/js/handlebars-v3.0.1.js"></script>
    <script src="/static/js/duty_schedule.js?v=20190529001"></script>
    <script src="/static/js/dataTables.colVis.js"></script>
    <script src="/static/js/flatpickr.js"></script>
    <script src="/static/js/zh.js"></script>
{% endblock %}
{% block css %}
    <link href="/static/css/jquery.dataTables.css" rel="stylesheet" type="text/css">
    <link href="/static/css/mycss.css" rel="stylesheet" type="text/css">
    <link href="/static/css/dataTables.colVis.css" rel="stylesheet" type="text/css">
    <link href="/static/css/flatpickr.css" rel="stylesheet" type="text/css">
    <link href="/static/css/flatpickr_material_green.css" rel="stylesheet" type="text/css">
{% endblock %}
